#include<stdio.h>
#include<sys/stat.h>
#include<sys/types.h>
#include<fcntl.h>
#include<stdlib.h>

int main()
{
	//int fd = open("a.txt",O_RDWR);



	//int fd = open("a.txt",O_RDWR|O_CREAT,0644);

	//int fd = open("a.txt",O_RDWR|O_CREAT|O_EXCL,0644);

	int fd = open("a.txt",O_RDWR|O_CREAT|O_TRUNC,0644);


	if(fd==-1){
	
		perror("open");
		return -1;
	}
	
	printf("open success!\n");

	close(fd);
	
	return 0;
}